/*
 * @Author: your name
 * @Date: 2020-05-14 21:28:32
 * @LastEditTime: 2020-05-14 21:38:11
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \ts\ts_test\enums.ts
 */

 enum Diretion {
   Up,
   Down,
   Left,
   Right
 }
 console.log(Diretion.Down)//1
 console.log(Diretion[0]) //Up

 enum DiretionString {
  Up = 'UP',
  Down = 'DOWN',
  Left = 'LEFT',
  Right = 'RIGHT'
}
const value = 'UP'

function setDirrtion(name:DiretionString){
  if(name === DiretionString.Up){
    console.log("执行逻辑")
  }else{
    console.log("不执行")
  }
}

setDirrtion(DiretionString.Up)
